/**
 * Description:
 * Class Name:final_execute
 * Date:2022/1/25 17:49
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第5章_面向对象_上.课后练习.第三题的总包.最终执行包;

import 疯狂Java讲义.第5章_面向对象_上.课后练习.第三题的总包.人.*;
import 疯狂Java讲义.第5章_面向对象_上.课后练习.第三题的总包.建筑物.*;

class test{
    // 通过这个，就可以完全以参数赋值来设定想要长度的数组
    public int[] xx;
    public test(int num){
        xx = new int[num];
    }
}

class Educator{
    public  school new_school = new school("新希望小学");
    public  supervisor[] supervisors_arr = new supervisor[5];
    public  teacher[] teachers_arr = new teacher[20];
    public  student[] students_arr = new student[100];

    public Educator(){
        for (int i = 1; i <= supervisors_arr.length; i++){
            supervisors_arr[i - 1] = new supervisor("班主任" + i, (int)(Math.random()*50 + Math.random()*10));
        }
        for (int i = 1; i <= teachers_arr.length; i++){
            teachers_arr[i-1] = new teacher("老师" + i, (int)(Math.random()*40 + Math.random()*10));
        }
        for (int i = 1; i <= students_arr.length; i++){
            students_arr[i - 1] = new student("学生" + i, (int)(Math.random()*30 + Math.random()*10));
        }
    }
}

public class final_execute {
    public static void main(String[] args) {
        var xx = new Educator();
        System.out.println("新希望小学现在有班主任：" + xx.supervisors_arr.length + "名。");
        System.out.println("新希望小学现在有老师：" + xx.teachers_arr.length + "名。");
        System.out.println("新希望小学现在有学生：" + xx.students_arr.length + "名。");

        System.out.println("下面列出学生的姓名：");
        for (var each: xx.students_arr){
            System.out.print(each.getName());
        }
    }
}
